Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add <bs>, <wait5>, <wait10>, <del> special keys (Packerisms) #989

Merged
merged 2 commits into from Oct 23, 2014

Conversation

aw
Copy link
Contributor

@aw aw commented Oct 5, 2014

I noticed a lot of people doing crazy hacks like: '<Wait>'*5 in their templates. This PR steals some good features from Packer, such as <Wait5> and <Wait10>.

I also added some other special keys to match-up with what's available in Packer templates.

@mpapis
Copy link
Collaborator

mpapis commented Oct 5, 2014

since we are using regexp we could handle the <wait(.*)> and use $1 for the value:

1.9.3-p547 :001 > /<wait(.*)>/ =~ "<wait>"
 => 0
1.9.3-p547 :002 > $1
 => ""
1.9.3-p547 :003 > /<wait(.*)>/ =~ "<wait5>"
 => 0
1.9.3-p547 :004 > $1
 => "5"

@mpapis
Copy link
Collaborator

mpapis commented Oct 5, 2014

and great that you are working on making us closer to packer - want to add support for it's templates soon

@aw
Copy link
Contributor Author

aw commented Oct 5, 2014

👍

ok let me think about this.. could be dangerous but maybe your idea will work.

@mpapis
Copy link
Collaborator

mpapis commented Oct 5, 2014

you can always do <wait([[:digit:]]*)> add extra check for "" and append to_i:)

@aw
Copy link
Contributor Author

aw commented Oct 5, 2014

Yes I was thinking of using /<wait(\d*)>/ .. just doing some tests here.

@mpapis
Copy link
Collaborator

mpapis commented Oct 9, 2014

hey, any progress? need help with that? or should I merge and add the regexp thing?

@aw
Copy link
Contributor Author

aw commented Oct 9, 2014

Sorry, I'll get back to this on the weekend.

@mpapis
Copy link
Collaborator

mpapis commented Oct 9, 2014

thanks

@mpapis
Copy link
Collaborator

mpapis commented Oct 15, 2014

oh the weekend past, let me know if you still want to work on the improvement or if I should finish it.

mpapis added a commit that referenced this pull request Oct 23, 2014
Add <bs>, <wait5>, <wait10>, <del> special keys (Packerisms)
@mpapis mpapis merged commit fe10285 into jedi4ever:master Oct 23, 2014
mpapis added a commit that referenced this pull request Oct 23, 2014
@mpapis mpapis removed the need info label Oct 23, 2014
@mpapis
Copy link
Collaborator

mpapis commented Oct 23, 2014

and added the matching, let me know how it works for you (... my vbox just died)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants